/**
 * @Title: UploadDataController.java
 * @Package com.dz.mvc.controller
 * @author pengyu
 * @date 2015年12月16日 上午10:21:55
 * @version V1.0
 */
package tt.dz.mvc.controller.middleware;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import tt.dz.service.middleware.UploadDataService;
import tt.dz.util.StringUtil;
@Controller
public class UploadDataController {
	/**
	 * 日志对象
	 */
	private Logger logger = LoggerFactory.getLogger(UploadDataController.class);
	@Autowired
	UploadDataService uploadDataService;
	//5.4.1	充电状态召集（弃用，从v1.2协议开始不再使用） 	 桩上传遥测数据    header[6]  是  case "72":
	@RequestMapping("/uploadTelemeter") 
	public String uploadTelemeter(HttpServletRequest request, HttpServletResponse response) throws Exception {
		Map<String,String> map = StringUtil.getParameterByMiddle(request);
		return uploadDataService.uploadTelemeter(map);
	}
	// 遥信 73 2.1版本中不再由此接口
	
	//遥脉  74
	@RequestMapping("/uploadRemotePulse") 
	public String uploadRemotePulse(HttpServletRequest request, HttpServletResponse response) throws Exception {
		Map<String,String> map = StringUtil.getParameterByMiddle(request);
		return uploadDataService.uploadRemotePulse(map);
	}
	
	
	// 账单主动上传 case "54": $this->uploadBill($thisDate);
	@RequestMapping("/uploadBill") 
	public String uploadBill(HttpServletRequest request, HttpServletResponse response) throws Exception {
		Map<String,String> map = StringUtil.getParameterByMiddle(request);
		return uploadDataService.uploadBill(map);
	}
}
